﻿using System;
using System.Web;

namespace Pylor.Web
{
    public class ForbiddenException : ApplicationException
    {
        public ForbiddenException(HttpContextBase context, string resource)
        : base(string.Format(Resources.ForbiddenMessageFormat, context.User.Identity.Name, resource))
        {
            Resource = resource;
            Username = context.User.Identity.Name;
        }

        public string Resource { get; set; }
        public string Username { get; set; }
    }
}